import { computed, Ref } from 'vue'
import { TotalData, NumData } from '../types'

/**
 * 心理咨询类型分布
 */
export function usePsychologicalCounselingTypeDistribution({
  numData,
  totalData,
}: {
  numData: Ref<NumData | null>
  totalData: Ref<TotalData | null>
}) {
  return {
    completeTestNum: computed(
      () => numData.value?.finishTestNum?.[0]?.num || 0
    ),
    allTestNum: computed(() => numData.value?.allTestNum?.[0]?.num || 0),
    noCompleteTestNum: computed(
      () => numData.value?.finishNoTestNum?.[0]?.num || 0
    ),
    studentNum: computed(() => totalData.value?.studentTotal),
    teacherNum: computed(() => totalData.value?.teacherTotal),
  }
}
